<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>{} 大括号 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../MyGitbook_new/js/shiti.html" />
    
    
    <link rel="prev" href="../../MyGitbook_new/js/Drag_drop.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="4.5"
        data-chapter-title="{} 大括号"
        data-filepath="MyGitbook_new/js/Braces.md"
        data-basepath="../.."
        data-revision="Fri Dec 22 2017 15:27:24 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="MyGitbook_new/css/steps.html">
            
                
                    <a href="../../MyGitbook_new/css/steps.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        手机端跳转js
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="MyGitbook_new/css/dassss.html">
            
            <span><b>1.1.</b> 第一天</span>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="MyGitbook_new/css/day1.html">
            
                
                    <a href="../../MyGitbook_new/css/day1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        3D动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3" data-path="MyGitbook_new/js/regular.html">
            
                
                    <a href="../../MyGitbook_new/js/regular.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        正则
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4" data-path="MyGitbook_new/js/js.html">
            
                
                    <a href="../../MyGitbook_new/js/js.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        js
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="MyGitbook_new/js/function_js.html">
            
                
                    <a href="../../MyGitbook_new/js/function_js.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        函数的声明方式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="MyGitbook_new/js/call_apply_bind.html">
            
                
                    <a href="../../MyGitbook_new/js/call_apply_bind.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        JS中改变this指向的方法(call和apply、bind)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="MyGitbook_new/js/Dom.html">
            
                
                    <a href="../../MyGitbook_new/js/Dom.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        Dom入门教程图解
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="MyGitbook_new/js/Drag_drop.html">
            
                
                    <a href="../../MyGitbook_new/js/Drag_drop.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        JS拖拽元素原理及实现
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="4.5" data-path="MyGitbook_new/js/Braces.html">
            
                
                    <a href="../../MyGitbook_new/js/Braces.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        {} 大括号
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="MyGitbook_new/js/shiti.html">
            
                
                    <a href="../../MyGitbook_new/js/shiti.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        试题
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h3 id="&#x5927;&#x62EC;&#x53F7;">{} &#x5927;&#x62EC;&#x53F7;</h3>
<pre><code>&#x8868;&#x793A;&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5927;&#x90E8;&#x5206;&#x60C5;&#x51B5;&#x4E0B;&#x8981;&#x6709;&#x6210;&#x5BF9;&#x7684;&#x5C5E;&#x6027;&#x548C;&#x503C;&#xFF0C;&#x6216;&#x662F;&#x51FD;&#x6570;&#x3002;
</code></pre><pre><code class="lang-javascript"><span class="hljs-keyword">var</span> LangShen = {<span class="hljs-string">&quot;Name&quot;</span>:<span class="hljs-string">&quot;Zhangsan&quot;</span>,<span class="hljs-string">&quot;Age&quot;</span>:<span class="hljs-string">&quot;18&quot;</span>}; 
    &#x58F0;&#x660E;&#x4E86;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;&#x201C;LangShen&#x201D;&#x7684;&#x5BF9;&#x8C61;,&#x591A;&#x4E2A;&#x5C5E;&#x6027;&#x6216;&#x51FD;&#x6570;&#x7528;,&#xFF08;&#x9017;&#x53F7;&#xFF09;&#x9694;&#x5F00;&#xFF0C;&#x56E0;&#x4E3A;&#x662F;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;.
    &#x8BBF;&#x95EE;&#x65F6;&#xFF1A;&#x7528;.&#xFF08;&#x70B9;&#xFF09;&#x6765;&#x5C42;&#x5C42;&#x8BBF;&#x95EE;&#xFF0C;&#x5982;&#xFF1A;LangShen.Name&#x3001;LangShen.AGE
    &#x6570;&#x7EC4;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x8BBF;&#x95EE;&#xFF1A;&#x5982;&#xFF1A;LangShen[<span class="hljs-string">&quot;Name&quot;</span>]&#x3001;LangShen[<span class="hljs-string">&quot;Age&quot;</span>],&#x5728;<span class="hljs-built_in">JSON</span>&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E2D;&#x7ECF;&#x5E38;&#x7528;&#xFF0C;
&#x9664;&#x6B64;&#x4E4B;&#x5916;&#xFF0C;&#x6211;&#x4EEC;&#x5E73;&#x65F6;&#x5199;&#x51FD;&#x6570;&#x7EC4;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E5F;&#x7ECF;&#x5E38;&#x7528;&#x5230;,&#x5982;&#xFF1A;
    <span class="hljs-keyword">var</span> LangShen = {
        Name = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
            <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;Zhangsan&quot;</span>;
        },
        Age = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
            <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;18&quot;</span>;
        }
    }
    &#x8C03;&#x7528;&#x65B9;&#x5F0F;&#x5DEE;&#x4E0D;&#x591A;&#xFF0C;&#x56E0;&#x4E3A;&#x662F;&#x51FD;&#x6570;&#x7EC4;&#xFF0C;&#x6240;&#x4EE5;&#x8981;&#x52A0;&#x4E0A;()&#xFF0C;&#x5982;&#xFF1A;alert(LangShen.Name());
</code></pre>
<h3 id="&#x4E2D;&#x62EC;&#x53F7;">[ ]&#x4E2D;&#x62EC;&#x53F7;</h3>
<pre><code>&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x7406;&#x89E3;&#x4E3A;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x5BF9;&#x8C61;&#x3002;
</code></pre><pre><code class="lang-javascript">&#x5982;&#xFF1A;<span class="hljs-keyword">var</span> LangShen = [ <span class="hljs-string">&quot;Name&quot;</span>,<span class="hljs-string">&quot;LangShen&quot;</span>,<span class="hljs-string">&quot;AGE&quot;</span>,<span class="hljs-string">&quot;28&quot;</span> ]; 
&#x7B49;&#x4EF7;&#x4E8E;&#xFF1A;<span class="hljs-keyword">var</span> LangShen = <span class="hljs-built_in">Array</span>( <span class="hljs-string">&quot;Name&quot;</span>,<span class="hljs-string">&quot;LangShen&quot;</span>,<span class="hljs-string">&quot;AGE&quot;</span>,<span class="hljs-string">&quot;28&quot;</span> ); 

&#x6BCF;&#x4E2A;&#x503C;&#x6216;&#x51FD;&#x6570;&#xFF0C;&#x90FD;&#x662F;&#x72EC;&#x7ACB;&#x7684;&#xFF0C;&#x591A;&#x4E2A;&#x503C;&#x4E4B;&#x95F4;&#x53EA;&#x7528;,&#xFF08;&#x9017;&#x53F7;&#xFF09;&#x9694;&#x5F00;&#xFF0C;&#x56E0;&#x4E3A;&#x662F;&#x6570;&#x7EC4;&#x5BF9;&#x8C61;
</code></pre>
<h3 id="&#x5982;&#x4F55;&#x8BBF;&#x95EE;&#x6570;&#x7EC4;&#xFF1F;">&#x5982;&#x4F55;&#x8BBF;&#x95EE;&#x6570;&#x7EC4;&#xFF1F;</h3>
<pre><code class="lang-javascript">alert( LangShen[<span class="hljs-number">0</span>] );
</code></pre>
<h3 id="-&#x548C;--&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#xFF1F;">{ } &#x548C;[ ] &#x4E00;&#x8D77;&#x4F7F;&#x7528;&#xFF1F;</h3>
<pre><code>{ } &#x662F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;[ ] &#x662F;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x7EC4;&#x6210;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x6570;&#x7EC4;
</code></pre><pre><code class="lang-javascript"><span class="hljs-keyword">var</span> LangShen = { <span class="hljs-string">&quot;Name&quot;</span>:<span class="hljs-string">&quot;Langshen&quot;</span>, 
<span class="hljs-string">&quot;MyWife&quot;</span>:[ <span class="hljs-string">&quot;LuLu&quot;</span>,<span class="hljs-string">&quot;26&quot;</span> ], 
<span class="hljs-string">&quot;MySon&quot;</span>:[{<span class="hljs-string">&quot;Name&quot;</span>:<span class="hljs-string">&quot;Son1&quot;</span>},{<span class="hljs-string">&quot;Name&quot;</span>:<span class="hljs-string">&quot;Son2&quot;</span>},{<span class="hljs-string">&quot;Name&quot;</span>:<span class="hljs-string">&quot;Son3&quot;</span>}] 
}
</code></pre>
<h3 id="&#x5982;&#x4F55;&#x8BBF;&#x95EE;&#x5BF9;&#x8C61;&#x6570;&#x7EC4;&#xFF1F;">&#x5982;&#x4F55;&#x8BBF;&#x95EE;&#x5BF9;&#x8C61;&#x6570;&#x7EC4;&#xFF1F;</h3>
<pre><code class="lang-javascript">&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x91CC;&#x9762;&#x7684;&#x7B2C;&#x4E00;&#x9879;&#x662F;&#x4E2A;&#x5C5E;&#x6027;&#xFF0C;&#x7B2C;&#x4E8C;&#x9879;&#x662F;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#xFF0C;&#x7B2C;&#x4E09;&#x4E2A;&#x662F;&#x5305;&#x542B;
&#x6709;&#x591A;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x6570;&#x7EC4;&#x3002;&#x8C03;&#x7528;&#x8D77;&#x6765;&#xFF0C;&#x4E5F;&#x662F;&#x4E00;&#x5C42;&#x4E00;&#x5C42;&#x8BBF;&#x95EE;&#xFF0C;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#x7528;.&#xFF08;&#x70B9;&#xFF09;
&#x53E0;&#x52A0;&#xFF0C;&#x6570;&#x7EC4;&#x7528; [&#x4E0B;&#x6807;] &#x6765;&#x8BBF;&#x95EE;.

&#x5982;&#xFF1A;alert( LangShen.MySon[<span class="hljs-number">1</span>].Name ) ;  <span class="hljs-comment">//LangShen&#x58F0;&#x660E;&#x5BF9;&#x8C61;&#x6570;&#x7EC4;&#x88C5;&#x8F7D;&#x7684;&#x53D8;&#x91CF;&#x540D;&#xFF1B;</span>
MySon&#x6570;&#x7EC4;&#xFF0C;&#x4ED6;&#x7684;[]&#x8868;&#x793A;&#x8981;&#x8BBF;&#x95EE;&#x7684;&#x4E0B;&#x6807;
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../MyGitbook_new/js/Drag_drop.html" class="navigation navigation-prev " aria-label="Previous page: JS拖拽元素原理及实现"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../MyGitbook_new/js/shiti.html" class="navigation navigation-next " aria-label="Next page: 试题"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
